import React from 'react';
import {
  HomeOutlined,
  UserOutlined,
  TeamOutlined,
  LockOutlined,
  MenuOutlined,
  SettingOutlined,
  ProfileOutlined,
} from '@ant-design/icons';

// 图标映射表，将字符串映射到实际的图标组件
const IconMap: Record<string, React.ReactNode> = {
  HomeOutlined: <HomeOutlined />,
  UserOutlined: <UserOutlined />,
  TeamOutlined: <TeamOutlined />,
  LockOutlined: <LockOutlined />,
  MenuOutlined: <MenuOutlined />,
  SettingOutlined: <SettingOutlined />,
  ProfileOutlined: <ProfileOutlined />,
};

// 根据字符串获取图标组件
export const getIcon = (name?: string): React.ReactNode => {
  if (!name) return null;
  return IconMap[name] || null;
};

export default IconMap;
